<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
</head>
<body>
    <script>
        // 函数
        function getWeb() {
            let web = "www.baidu.com";
            console.log(web);
        }
        getWeb();
        // 默认值
        function getPage(page = 10) {
            return page;
        }
        console.log(getPage());
        console.log(getPage(11));
        // 匿名函数
        let sub = function(num1, num2) {
            return num1 - num2;
        };
        console.log(sub(30, 11));
        // 箭头函数，也是一种匿名函数，省略function
        let plus = (num1, num2) => {
            return num1 + num2;
        };
        console.log(plus(30, 11));
        // 隐式返回
        let plus2 = (num1, num2) => num1 + num2;
        console.log(plus2(30, 115));

    </script>
</body>
</html>